package com.liu.stockmarket.ui.datacenter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.fragment.app.FragmentPagerAdapter
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.liu.stockmarket.ui.datacenter.ui.main.PlaceholderFragment

import com.liu.stockmarket.ui.datacenter.ui.newbond.NewBondFragment
import com.liu.stockmarket.ui.datacenter.ui.quotation.QuotationFragment

/**
 * A [FragmentPagerAdapter] that returns a fragment corresponding to
 * one of the sections/tabs/pages.
 */
class SectionsPagerAdapter(fragment: FragmentActivity) :
    FragmentStateAdapter(fragment) {

    private val fragments:MutableList<Fragment> = mutableListOf()

    init {
        fragments.add(NewBondFragment.newInstance("1","2"))
        fragments.add(QuotationFragment.newInstance())
    }



    override fun getItemCount(): Int {
        return fragments.size
    }

    override fun createFragment(position: Int): Fragment {
        return fragments[position]
    }
}